<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template basic_exception_handler_logger</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Log v2">
<link rel="up" href="../../../logging_sources.html#header.boost.log.sources.exception_handler_feature_hpp" title="Header &lt;boost/log/sources/exception_handler_feature.hpp&gt;">
<link rel="prev" href="wchannel_logger_mt.html" title="Class template wchannel_logger_mt">
<link rel="next" href="exception_handler.html" title="Struct exception_handler">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="wchannel_logger_mt.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../logging_sources.html#header.boost.log.sources.exception_handler_feature_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="exception_handler.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.log.sources.basic_exception_h_idm30992"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_exception_handler_logger</span></h2>
<p>boost::log::sources::basic_exception_handler_logger — Exception handler feature implementation. </p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../logging_sources.html#header.boost.log.sources.exception_handler_feature_hpp" title="Header &lt;boost/log/sources/exception_handler_feature.hpp&gt;">boost/log/sources/exception_handler_feature.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BaseT<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="basic_exception_h_idm30992.html" title="Class template basic_exception_handler_logger">basic_exception_handler_logger</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">BaseT</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">threading_model</span>                                                              <a name="boost.log.sources.basic_exception_h_idm30992.threading_model"></a><span class="identifier">threading_model</span><span class="special">;</span>         <span class="comment">// Threading model being used. </span>
  <span class="keyword">typedef</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">final_type</span>                                                                   <a name="boost.log.sources.basic_exception_h_idm30992.final_type"></a><span class="identifier">final_type</span><span class="special">;</span>              <span class="comment">// Final logger type. </span>
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                                                                             <a name="boost.log.sources.basic_exception_h_idm30992.exception_handler_type"></a><span class="identifier">exception_handler_type</span><span class="special">;</span>  <span class="comment">// Exception handler function type. </span>
  <span class="keyword">typedef</span> <span class="identifier">strictest_lock</span><span class="special">&lt;</span> <span class="identifier">typenamebase_type</span><span class="special">::</span><span class="identifier">open_record_lock</span><span class="special">,</span> <span class="identifier">no_lock</span><span class="special">&lt;</span> <span class="identifier">threading_model</span> <span class="special">&gt;</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <a name="boost.log.sources.basic_exception_h_idm30992.open_record_lock"></a><span class="identifier">open_record_lock</span><span class="special">;</span>        <span class="comment">// Lock requirement for the open_record_unlocked method. </span>
  <span class="keyword">typedef</span> <span class="identifier">strictest_lock</span><span class="special">&lt;</span> <span class="identifier">typenamebase_type</span><span class="special">::</span><span class="identifier">push_record_lock</span><span class="special">,</span> <span class="identifier">no_lock</span><span class="special">&lt;</span> <span class="identifier">threading_model</span> <span class="special">&gt;</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <a name="boost.log.sources.basic_exception_h_idm30992.push_record_lock"></a><span class="identifier">push_record_lock</span><span class="special">;</span>        <span class="comment">// Lock requirement for the push_record_unlocked method. </span>
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                                                                             <a name="boost.log.sources.basic_exception_h_idm30992.swap_lock"></a><span class="identifier">swap_lock</span><span class="special">;</span>               <span class="comment">// Lock requirement for the swap_unlocked method. </span>

  <span class="comment">// <a class="link" href="basic_exception_h_idm30992.html#boost.log.sources.basic_exception_h_idm30992construct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="basic_exception_h_idm30992.html#idm31041-bb"><span class="identifier">basic_exception_handler_logger</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_exception_h_idm30992.html#idm31044-bb"><span class="identifier">basic_exception_handler_logger</span></a><span class="special">(</span><a class="link" href="basic_exception_h_idm30992.html" title="Class template basic_exception_handler_logger">basic_exception_handler_logger</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_exception_h_idm30992.html#idm31050-bb"><span class="identifier">basic_exception_handler_logger</span></a><span class="special">(</span><a class="link" href="basic_exception_h_idm30992.html" title="Class template basic_exception_handler_logger">basic_exception_handler_logger</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_nothrow_move_constructible</span><span class="special">&lt;</span> <span class="identifier">base_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span> <span class="special">&amp;&amp;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_nothrow_move_constructible</span><span class="special">&lt;</span> <span class="identifier">exception_handler_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> 
    <span class="keyword">explicit</span> <a class="link" href="basic_exception_h_idm30992.html#idm31056-bb"><span class="identifier">basic_exception_handler_logger</span></a><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_exception_h_idm30992.html#idm31017-bb">public member functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> HandlerT<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="basic_exception_h_idm30992.html#idm31018-bb"><span class="identifier">set_exception_handler</span></a><span class="special">(</span><span class="identifier">HandlerT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_exception_h_idm30992.html#idm31063-bb">protected member functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> <span class="identifier">record</span> <a class="link" href="basic_exception_h_idm30992.html#idm31064-bb"><span class="identifier">open_record_unlocked</span></a><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_exception_h_idm30992.html#idm31073-bb"><span class="identifier">push_record_unlocked</span></a><span class="special">(</span><span class="identifier">record</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_exception_h_idm30992.html#idm31080-bb"><span class="identifier">swap_unlocked</span></a><span class="special">(</span><a class="link" href="basic_exception_h_idm30992.html" title="Class template basic_exception_handler_logger">basic_exception_handler_logger</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm58630"></a><h2>Description</h2>
<div class="refsect2">
<a name="idm58632"></a><h3>
<a name="boost.log.sources.basic_exception_h_idm30992construct-copy-destruct"></a><code class="computeroutput">basic_exception_handler_logger</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idm31041-bb"></a><span class="identifier">basic_exception_handler_logger</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Default constructor. The constructed logger does not have an exception handler. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm31044-bb"></a><span class="identifier">basic_exception_handler_logger</span><span class="special">(</span><a class="link" href="basic_exception_h_idm30992.html" title="Class template basic_exception_handler_logger">basic_exception_handler_logger</a> <span class="keyword">const</span> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm31050-bb"></a><span class="identifier">basic_exception_handler_logger</span><span class="special">(</span><a class="link" href="basic_exception_h_idm30992.html" title="Class template basic_exception_handler_logger">basic_exception_handler_logger</a> <span class="special">&amp;&amp;</span> that<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_nothrow_move_constructible</span><span class="special">&lt;</span> <span class="identifier">base_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span> <span class="special">&amp;&amp;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_nothrow_move_constructible</span><span class="special">&lt;</span> <span class="identifier">exception_handler_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">;</span></pre>
<p>Move constructor </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="idm31056-bb"></a><span class="identifier">basic_exception_handler_logger</span><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre>
<p>Constructor with arguments. Passes arguments to other features. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm58706"></a><h3>
<a name="idm31017-bb"></a><code class="computeroutput">basic_exception_handler_logger</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> HandlerT<span class="special">&gt;</span> 
  <span class="keyword">void</span> <a name="idm31018-bb"></a><span class="identifier">set_exception_handler</span><span class="special">(</span><span class="identifier">HandlerT</span> <span class="keyword">const</span> <span class="special">&amp;</span> handler<span class="special">)</span><span class="special">;</span></pre>
<p>The method sets exception handler function. The function will be called with no arguments in case if an exception occurs during either <code class="computeroutput">open_record</code> or <code class="computeroutput">push_record</code> method execution. Since exception handler is called from a <code class="computeroutput">catch</code> statement, the exception can be rethrown in order to determine its type.</p>
<p>By default no handler is installed, thus any exception is propagated as usual.</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p><code class="computeroutput">utility/exception_handler.hpp</code> </p>
<p>
</p>
<p>

</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>The exception handler can be invoked in several threads concurrently.</p></td></tr>
</table></div>
<p>
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>Thread interruptions are not affected by exception handlers. </p></td></tr>
</table></div>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">handler</code></span></p></td>
<td><p>Exception handling function</p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li></ol></div>
</div>
<div class="refsect2">
<a name="idm58751"></a><h3>
<a name="idm31063-bb"></a><code class="computeroutput">basic_exception_handler_logger</code> protected member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> <span class="identifier">record</span> <a name="idm31064-bb"></a><span class="identifier">open_record_unlocked</span><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre>
<p>Unlocked <code class="computeroutput">open_record</code> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm31073-bb"></a><span class="identifier">push_record_unlocked</span><span class="special">(</span><span class="identifier">record</span> <span class="special">&amp;&amp;</span> rec<span class="special">)</span><span class="special">;</span></pre>
<p>Unlocked <code class="computeroutput">push_record</code> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm31080-bb"></a><span class="identifier">swap_unlocked</span><span class="special">(</span><a class="link" href="basic_exception_h_idm30992.html" title="Class template basic_exception_handler_logger">basic_exception_handler_logger</a> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Unlocked swap </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2007-2024 Andrey Semashev<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="wchannel_logger_mt.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../logging_sources.html#header.boost.log.sources.exception_handler_feature_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="exception_handler.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
